import request from '@/utils/request'

// 查询工单任务列表
export function listWorkTask(query) {
  return request({
    url: '/yyj/pro/workTask/list',
    method: 'get',
    params: query
  })
}

// 查询工单任务条件
export function conditionWorkTask() {
  return request({
    url: '/yyj/pro/workTask/condition',
    method: 'get'
  })
}

// 查询工单任务详细
export function getWorkTask(wtaskCode) {
  return request({
    url: '/yyj/pro/workTask/' + wtaskCode,
    method: 'get'
  })
}

// 查询工单任务人员
export function getUser(wtaskCode) {
  return request({
    url: '/yyj/pro/workTask/user/' + wtaskCode,
    method: 'get'
  })
}

// 新增工单任务
export function addWorkTask(data) {
  return request({
    url: '/yyj/pro/workTask',
    method: 'post',
    data: data
  })
}

/**
 * 派工
 */
export function arrangePeo(data) {
  return request({
    url: '/yyj/pro/workTask/arrangePeo',
    method: 'put',
    data: data
  })
}

/**
 * 开工
 */
export function startWork(data) {
  return request({
    url: '/yyj/pro/workTask/startWork',
    method: 'put',
    data: data
  })
}

// 删除工单任务
export function delWorkTask(wtaskCode) {
  return request({
    url: '/yyj/pro/workTask/' + wtaskCode,
    method: 'delete'
  })
}
